import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/* 懒加载 */
const Home = () => import('views/Home/Home.vue')
const Discover = () => import('views/Discover/Discover.vue')
const Order = () => import('views/Order/Order.vue')
const Profile = () => import('views/Profile/Profile.vue')

const routes = [
  {
    path: '/',
    redirect: 'home'
  }, {
    path: '/home',
    name: 'home',
    component: Home
  }, {
    path: '/discover',
    name: 'discover',
    component: Discover
  }, {
    path: '/order',
    name: 'order',
    component: Order
  }, {
    path: '/profile',
    name: 'profile',
    component: Profile
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
